package com.xuecheng.basic.controller;


import com.xuecheng.basic.service.CategoryService;
import com.xuecheng.commons.model.vo.CategoryVo;
import com.xuecheng.commons.model.vo.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 课程分类 前端控制器
 * </p>
 *
 * @author itheima
 * @since 2024-05-02
 */
@Slf4j
@RestController
public class CategoryController {
    @Autowired
    private CategoryService categoryService;

    /*
    * 查询所有分类
    * */
    @GetMapping("/category/tree-nodes")
    public ResponseResult<CategoryVo> findAll(){
        return categoryService.findAll();
    }

}
